|
|
|
|
|
|
|
The Generate method can read the MDB in the DBName property and create a script with the name in the Script property. |
|
|
|
|
|
|
|
|
Public Sub Generate()
'
' calls autogen routine
'
If Trim(strDBName) <> "" And Trim(strScript) <> "" Then
AutoGen strDBName, strScript
Else
AutoGen
End If
'
End Sub |
|
|
|
|
|
|
|
|
You can also add the Edit and Create methods to allow external programs to start the SQL-VB5 editor to edit or build new scripts. |
|
|
|
|
|
|
|
|
Public Sub Edit()
'
' call edit routine
'
If Trim(strScript) <> "" Then
LoadNotePadFile "", strScript
Else
LoadNotePadFile "Select Script to Edit"
End If
'
End Sub |
|
|
|
|
|
|
|
|
Public Sub Create()
'
' calls new file routine
'
If Trim(strScript) <> "" Then
LoadNotePadFile "", strScript
Else
LoadNotePadFile "Enter Name of New Script"
End If
'
End Sub |
|
|
|
|
|
|
|
|
Finally, what interface would be complete if it didn't allow external calls to the About box? |
|
|
|
|
|
|
|
|
Public Sub About()
'
' calls about box
'
frmAbout.Show vbModal
'
End Sub |
|
|
|
|
|
|
|
|
That's it for the object model. Save and compile the program. In the next step you build a quick Visual Basic application to test the object model. |
|
|
|
|
|